package lab_09.task3.com.acme.bankapp.domain.bank;

import java.util.Arrays;

public class Bank {
	static private final int MAX_CLIENTS = 10;
	private Client [] clients = new Client [MAX_CLIENTS];
	private int number = 0; //number of clients
	
	public Client addClient(Client client) {
		if (number >= MAX_CLIENTS) {
			return null; //maximum number of clients is reached
		}
		clients[number] = client;
		number++;
		return  client;			
	}
	
	public Client addClient(Gender gender, String name, double balance) {
		Client client = new Client(gender, name, balance);	
		return addClient(client);
	}
	
	public Client [] getClients() {
		return Arrays.copyOfRange(clients, 0, number);
	}

	
}
